package org.wzg.aityweb.Tools;

import dev.langchain4j.agent.tool.Tool;
import dev.langchain4j.service.V;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.wzg.aityweb.Entity.ConsultOrder;
import org.wzg.aityweb.WebService.ConSultService;

@Component
public class LlmTools {

    @Autowired
    private ConSultService consultService;

    @Tool("信息登记")
    public void addOrder(@V("姓名")String name, @V("手机号")String phone)
    {
        ConsultOrder order = new ConsultOrder();
        order.setName(name);
        order.setPhone(phone);
        consultService.insertMsg( order);
    }
    @Tool("信息查询")
    public ConsultOrder queryOrder(@V("手机号")String phone){
        return consultService.orderornot(phone)==null? null:consultService.orderornot(phone);
    }
}
